﻿@using DAL.Helpers;

@model Web.Models.FilmeViewModel

@{
    ViewBag.Title = "Editar Filme";
}

<h2>Editar Filme - @(Model.Titulo)</h2>

@using (Html.BeginForm()) {
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>Editar Filme</legend>

        @Html.HiddenFor(model => model.Id)

        @Html.HiddenFor(model => model.Titulo)

        <div class="editor-label">
            @Html.LabelFor(model => model.TipoMidia)
        </div>
        <div class="editor-field">
            @{
                var tipoMidiaList = new Dictionary<short, string>();
                tipoMidiaList.Add((short)TipoMidia.Fisica, Enum.GetName(typeof(TipoMidia), TipoMidia.Fisica));
                tipoMidiaList.Add((short)TipoMidia.Digital, Enum.GetName(typeof(TipoMidia), TipoMidia.Digital));
            }

            @Html.DropDownList("TipoMidia", new SelectList(tipoMidiaList, "Key", "Value", Model.TipoMidia))
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Descricao)
        </div>
        <div class="editor-field">
            @Html.TextAreaFor(model => model.Descricao)
            @Html.ValidationMessageFor(model => model.Descricao)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.UrlImagem)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.UrlImagem)
            @Html.ValidationMessageFor(model => model.UrlImagem)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.UrlTrailer)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.UrlTrailer)
            @Html.ValidationMessageFor(model => model.UrlTrailer)
        </div>

        <p>
            <input type="submit" value="Salvar" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Voltar para Meus Filmes", "Index")
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}